# Maintainer: Paul Moore <p.f.moore@gmail.com>

_realname=file
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=5.32
pkgrel=1
pkgdesc='Determine the type of a file from its contents (mingw-w64)'
arch=('any')
url='https://www.darwinsys.com/file/'
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-libsystre")
source=(ftp://ftp.astron.com/pub/file/${_realname}-${pkgver}.tar.gz)
sha256sums=('8639dc4d1b21e232285cd483604afc4a6ee810710e00e579dbe9591681722b50')
options=('strip' '!libtool' 'staticlibs')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  ./configure --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST}

  make
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR="${pkgdir}"

  # Licenses
  install -Dm644 "${srcdir}/${_realname}-${pkgver}/README" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/README"
  install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
